<div id="contentLeft">
	<img style="position: fixed; top: 0;z-index:9999;" src="<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/logoFeed.png';?>">&nbsp
</div>
<div id="contentDiv">
	<div style="width: 97%; margin: 0 auto;">
		<div id="searchDiv" style="width: 60%; float:left;padding-top: 7px;">
			<form>
				<input type="text" name="searchFriend" style="width: 100%;height: 30px;float: left;z-index: 1;">
				<input type="button" onclick="alert('testing');" name="btnSearch" style="height: 30px;width: 50px;position: relative;background: #666666;z-index: 9999;float: right; margin-top: -30px;border: 0; background-image: url('<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/btnSearch.jpg';?>')">
			</form>
		</div>
		<div id="notificationDiv" style="width: 40%; float:left;padding-top: 12px; font-weight: bold;">
			<?php
				$name = Yii::app()->user->getName();
				$user_id = Yii::app()->user->getId();
			?>

			<ul style="list-style: none; float: right; padding: 0; margin: 0;font-weight: normal;z-index:9999;" id="ulNotification">
				<li style="float: right;width: 54px; height: 20px;margin-left: 7px;margin-right: 5px;" id="notificationSeting">
					<ul class="ulNotification">
						<li><strong>Chức năng khác</strong></li>
						<li>Thay đổi thông tin cá nhân</li>
						<li>Thêm danh sách nhạc mới</li>
						<li>Thêm nhạc</li>
						<li>
							<a href="<?php echo Yii::app()->request->baseUrl.'/Authenticate/logout/';?>">Đăng xuất</a>
						</li>
					</ul>
					<img id="notificationSeting" src="<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconNotificationSeting.jpg';?>">
					&nbsp<span class="spaceNotification" style="right: 74px;">|</span>
				</li>

				<li style="float: left;width: 20px; height: 20px;margin-left: 5px;background-image: url('<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconNotificationFriendshipRead.png';?>')" id="notificationFriend">
					<ul class="ulNotification" id="divNotificationFriend">
						<?php $this->renderPartial('//ajax/_notification-friendship');?>
					</ul>
					<canvas id="divQuantityNotificationFriendshipUnRead" width="20" height="10" style="margin-top: -20px; margin-left: 3px;">Your browser does not support the HTML5 canvas tag.</canvas>
				</li>
				<li style="float: left;width: 20px; height: 20px;margin-left: 5px;background-image: url('<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconNotificationMessengerRead.png';?>')" id="notificationMessage">
					<ul class="ulNotification" id="divNotificationMessenger">
						<?php $this->renderPartial('//ajax/_notification-messenger');?>
					</ul>
					<canvas id="divQuantityNotificationMessengerUnRead" width="20" height="10" style="margin-top: -20px; margin-left: 3px;">Your browser does not support the HTML5 canvas tag.</canvas>
				</li>
				<li style="float: left;width: 20px; height: 20px;margin-left:5px;background-image: url('<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconNotificationNewsRead.png';?>')" id="notificationNews">
					<ul class="ulNotification" id="divNotificationNews">
						<?php $this->renderPartial('//ajax/_notification-news');?>
					</ul>
					<canvas id="divQuantityNotificationNewsUnRead" width="20" height="10" style="margin-top: -20px; margin-left: 3px;">Your browser does not support the HTML5 canvas tag.</canvas>
				</li>
			</ul>
			<a href="<?php echo Yii::app()->request->baseUrl.'/page/news/';?>" style="float: right;">&nbsp;&nbsp;Trang chủ <span class="spaceNotification">|</span>&nbsp;</a>
			<a href="<?php echo Yii::app()->request->baseUrl.'/page/feed/';?>" style="float: right; margin-left: 5px;">
			<?php $data['user'] = UserController::view($user_id);?>
			<img src="<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/avatar/'.$data['user']['avatar'];?>" style="float:left;margin: 0 5px;border: solid 1px #464646;-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; width: 20px;"/>
				<?php echo Yii::app()->user->getName()?>&nbsp;<span class="spaceNotification">|</span>
			</a>
		</div>
	</div>
</div>
<script type="text/javascript">
	var currentNotification = '';
	//Chứa tên id của nút bấm notification để thực hiện click trong notification không bị tắt cửa sổ
	var notifications = [];

	var urlSendAjax  = "<?php echo Yii::app()->request->baseUrl; ?>/Ajax/";
	var urlImg = '<?php echo Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/';?>';
	var urlSoundNewMessenger = '<?php echo Yii::app()->request->baseUrl; ?>/themes/fly_high/assets/sound/new-messenger.mp3';
</script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/themes/fly_high/assets/js/notification.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/themes/fly_high/assets/js/messenger.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/themes/fly_high/assets/js/authenticate.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/themes/fly_high/assets/js/friendship.js"></script>
<script type="text/javascript">
	setInterval(function(){
	    checkOnline();
	    autoCheckNotification();
	}, 3000);
</script>
<style type="text/css">
	#header{
		height: 46px;
		background: #4e4e4e;
	}
	#notificationDiv>a,#notificationDiv>li {
		color: white !important;
	}
	.spaceNotification{
		color: #464646;font-size: 1.6em;position: absolute;top:6px;
	}
	.ulNotification{
		display: none; position: absolute; width: 300px;background: white; list-style: none;right:0;top:46px;padding: 0 5px 10px 10px;
		box-shadow: 0 1px 2px #ccc;
	}
	.ulNotification>li{
		margin-top: 5px;padding-bottom: 5px; border-bottom: solid 1px #464646;
	}
</style>